home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / Jogos de Azar / 1721-apuesten.swf / scripts / C_ChipsMenuCLASS.as < prev    next >
Text File  |  2006-01-17  |  1KB  |  55 lines

  1. _global.C_ChipsMenuCLASS = function()
  2. {
  3. };
  4. C_ChipsMenuCLASS.prototype = new MovieClip();
  5. C_ChipsMenuCLASS.prototype.onLoad = function()
  6. {
  7.    this.chips = [1,5,25,100];
  8.    this.buttons = [];
  9.    var chips_names = ["$1.00","$5.00","$25.00","$100.00"];
  10.    var c;
  11.    var i = 0;
  12.    while(i < this.chips.length)
  13.    {
  14.       c = this["ch_" + this.chips[i] + "_mc"];
  15.       c.chip = this.chips[i];
  16.       c.addAlt("Use " + chips_names[i] + " chips for betting");
  17.       c.onPress = function()
  18.       {
  19.          this.hideAlt();
  20.          this._parent.setChip(this.chip);
  21.       };
  22.       c.useHandCursor = false;
  23.       this.buttons.push(c);
  24.       i++;
  25.    }
  26.    this.setChip(this.curBet);
  27. };
  28. C_ChipsMenuCLASS.prototype.setChip = function(chip)
  29. {
  30.    var i = 0;
  31.    while(i < this.buttons.length)
  32.    {
  33.       this.buttons[i]._xscale = this.buttons[i]._yscale = 100;
  34.       i++;
  35.    }
  36.    var c = this["ch_" + chip + "_mc"];
  37.    c._xscale = c._yscale = 120;
  38.    this.curBet = chip;
  39.    this.ch_arow._x = c._x;
  40.    this.client.client[this.client.handler](this.curBet);
  41. };
  42. C_ChipsMenuCLASS.prototype.setChangeHandler = function(client)
  43. {
  44.    if(arguments.length == 1)
  45.    {
  46.       this.client = client;
  47.    }
  48.    else
  49.    {
  50.       this.client = {client:arguments[1],handler:arguments[0]};
  51.    }
  52. };
  53. ASSetPropFlags(_global,"C_ChipsMenuCLASS",131);
  54. Object.registerClass("C_ChipsMenuCLASS",C_ChipsMenuCLASS);
  55.